/*
 * @Autor: dingxiaolin
 * @Date: 2020-05-10 18:48:05
 * @LastEditors: dingxiaolin
 * @LastEditTime: 2021-03-18 19:17:24
 */

import {
    Dashboard,
    Login,
    NotFound,
    Settings,
    ArticleList,
    ArticleEdit,
    Notifications,
    NoAuth,
    Profile,
} from "../views";

export const mainRoutes = [
    {
        pathname: "/login",
        component: Login,
    },
    {
        pathname: "/404",
        component: NotFound,
    },
];

export const adminRoutes = [
    {
        pathname: "/admin/dashboard",
        component: Dashboard,
        title: "仪表盘",
        icon: "dashboard",
        isNav: true,
        roles: ["001", "002", "003"],
    },
    {
        pathname: "/admin/article",
        // component: ArticleList,
        title: "文章管理",
        icon: "unordered-list",
        isNav: true,
        roles: ["001", "002"],
        children: [
            {
                pathname: "/admin/article/notifications",
                component: Notifications,
                isNav: true,
                title: "文章通知",
                roles: ["001", "002", "003"],
            },
            {
                pathname: "/admin/article/list",
                component: ArticleList,
                isNav: true,
                title: "文章列表",
                roles: ["001", "002"],
            },
            {
                pathname: "/admin/article/edit/:id",
                component: ArticleEdit,
                isNav: false,
                title: "编辑文章",
                roles: ["001", "002"],
            },
        ],
    },
    {
        pathname: "/admin/noauth",
        component: NoAuth,
        isNav: false,
        roles: ["001", "002", "003"],
    },
    {
        pathname: "/admin/setting",
        component: Settings,
        title: "设置",
        icon: "setting",
        isNav: true,
        roles: ["001"],
        children: [
            {
                pathname: "/admin/setting/profile",
                component: Profile,
                title: "个人设置",
                isNav: true,
                roles: ["001", "002", "003"],
            },
        ],
    },
];
